﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace qf_cms.templates
{
	public partial class subArticle : System.Web.UI.Page
	{
		LogicLayer mgr = new LogicLayer();
		protected string aid = "", curTitle = "", curContent = "";

		protected void Page_Load(object sender, EventArgs e)
		{
			aid = Request.QueryString["aid"] + "";
			CMS_Article art = mgr.GetCMS_Article(aid);
			if (art != null)
			{
				curTitle = art.ArticleTitle;
				curContent = art.ArticleContent;
			}
		}

		protected void WriteLeftNav()
		{
			List<CMS_Article> artList = mgr.ListArticleInOneColumn(aid);
			if (artList != null)
			{
				string url = string.Empty;
				foreach (CMS_Article art in artList)
				{
					url = "/templates/subArticle.aspx?aid=" + art.ArticleID;
					if(art.ArticleID == aid)
						Response.Write("<a href=\"" + url + "\" class=\"l1on\">" + art.ArticleTitle + "</a>");
					else
						Response.Write("<a href=\"" + url + "\" >" + art.ArticleTitle + "</a>");
				}
			}
		}
	}
}